import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:enterprise_v6_app/app/core/http/http.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/entities/application/Inventory_system/getjob_responsibilities_detail_entity.dart';
import 'package:get/get.dart';

class ControlDetailsController extends GetxController {
  GetjobResponsibilitiesDetailEntity? data;

  /// 是否是展开状态
  bool isExpanded = false;

  /// 点击展开或者收起
  void onExpanded() {
    isExpanded = !isExpanded;
    update();
  }

  List<String> getPlanRecordEntity = [''];

  @override
  void onInit() {
    super.onInit();
    //查看详情
    getDetail();
  }

 void getDetail() async {
    final res = await HttpUtil().generateGetRequest<GetjobResponsibilitiesDetailEntity>(Interface.riskManagementGetDetail, queryParameters: {
      'id': Get.arguments ?? '',
    }).execute();
    res.onSuccess((result) {
      if (result.data != null) {
        data = result.data!;
      }
    });
    update();
  }
}
